package org.karelun.whiteboard.gef.cdo.actions;

import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.ui.IEditorPart;
import org.karelun.whiteboard.gef.cdo.ITransactionEditingDomain;

/**
 * @Author: KarelunHuang
 * @Date: Jan 22, 2013
 **/
public class CopyAction extends org.karelun.whiteboard.gef.ui.actions.CopyAction{

	public CopyAction(IEditorPart editor) {
		super(editor);
	}

	@Override
	protected boolean calculateEnabled() {
		CDOView cdoView = getEditingDomain().getCDOView();
		if(cdoView.isClosed()||cdoView.isReadOnly()){
			return false;
		}
		return super.calculateEnabled();
	}
	
	@Override
	protected ITransactionEditingDomain getEditingDomain() {
		return (ITransactionEditingDomain)super.getEditingDomain();
	}
}
